package
{
	import com.jyhg.Game;
	
	import flash.desktop.NativeApplication;
	import flash.desktop.SystemIdleMode;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	
	import starling.core.Starling;
	
	
	/**
	 * jas3Mobile
	 * @author: Jonny.Hong
	 * @date: 2014-2-26
	 */
	public class jas3Mobile extends Sprite
	{
		private var _myStarling:Starling;
		public function jas3Mobile()
		{
			super();
			
			// 支持 autoOrient
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			NativeApplication.nativeApplication.systemIdleMode = SystemIdleMode.KEEP_AWAKE;
			
			this.addEventListener(Event.ADDED_TO_STAGE , onAddedToStageHandler);
		}
		
		protected function onAddedToStageHandler(event:Event):void
		{
			this.removeEventListener(Event.ADDED_TO_STAGE , onAddedToStageHandler);
			_myStarling = new Starling(Game,stage);
			_myStarling.showStats = true;
			_myStarling.start();
		}
	}
}